package com.atung.parking.enums;

import lombok.Getter;

/**
 * @author Administrator
 */

@Getter
public enum ParkingIotApprovalState {
    PENDING(101, "未审核"),//
    APPROVED(102, "审核通过"),//
    REJECTED(103, "审核未通过");//

    private final Integer code;
    private final String description;

    ParkingIotApprovalState(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String getDescriptionByCode(Integer code) {
        for (ParkingIotApprovalState state : ParkingIotApprovalState.values()) {
            if (state.getCode().equals(code)) {
                return state.getDescription();
            }
        }
        return code.toString(); // 如果没有找到匹配的code，返回null
    }
}
